<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> -->
    <script src="./node_modules/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      {{count}}
      <button v-on:click.once="handleClick">click</button>
      <!-- <button @click="handleClick('1')">click</button>
      <button @click="handleClick('2')">click</button> -->
    </div>
    <script>
      // v-on -> 注册事件 -》 简写 @

      const app = new Vue({
        el: "#app",
        data: {
          count: 1,
        },

        methods: {
          handleClick(e) {
            // event
            console.log(e);
            // console.log("click", type);
            // this -> app
            // this.count -> this.$data.count
            // vue -> 代理
            this.count++;
          },
        },
      });

      console.log(app);
    </script>
  </body>
</html>
